package com.example.springboottransaction.repository;

import com.example.springboottransaction.pojo.Student;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentRepository {
    @Update(value = "insert into student(name,sex) values(#{student.name},#{student.sex})")
    void insertStudent(@Param("student") Student student);

    @Select(value = "select id,name,sex from student where id=(select @@IDENTITY)")
    Student findStudentByNear();

    @Select(value = "select id,name,sex from student")
    List<Student> testReadOnlyTrue();
}
